
* Replication Do-File: Determinants of China’s FDI in ECOWAS Countries
* Author: Josephine Elom Baham
* Date: 2025



* Load data
use "supplementary_dataset.xlsx"

*set data as Panel
xtset CID YEARS

* Descriptive statistics
sum FDISt PGDP INF NRR TO RegQual EXR

*Pairwise correlation
pwcorr

* Unit Root Tests (IPS)
xtunitroot ips FDISt
xtunitroot ips PGDP
xtunitroot ips EXR
xtunitroot ips D.EXR
xtunitroot ips INF
xtunitroot ips NRR
xtunitroot ips D.NRR
xtunitroot ips TO
xtunitroot ips D.TO
xtunitroot ips RegQual
xtunitroot ips D.RegQual

* Kao Cointegration Test
xtcointtest kao EXR RegQual TO NRR INF PGDP FDISt

* Panel ARDL Model 
* pmg estimation
xtpmg d.FDISt d.TO d.NRR d.PGDP d.EXR d.INF d.RegQual, lr (l.FDISt TO NRR PGDP EXR INF RegQual) replace pmg

estimates store pmg

* mg estimation
xtpmg d.FDISt d.TO d.NRR d.PGDP d.EXR d.INF d.RegQual, lr (l.FDISt TO NRR PGDP EXR INF RegQual) replace mg

hausman mg pmg, sigmamore

* Fixed Effects Robustness check
xtreg FDISt TO NRR PGDP EXR INF RegQual, fe
estimates store FE
xtreg FDISt TO NRR PGDP EXR INF RegQual, re
estimates store RE
asdoc hausman FE RE, sigmamore


* End of script
